#ifndef CLIENT_H
#define CLIENT_H

#include <QDialog>
#include <QTcpSocket>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QTcpSocket>
#include <QLabel>
#include <QTreeWidget>
#include <QHostInfo>

#include "../Common/bonjourrecord.h"
#include "bonjourservicebrowser.h"
#include "bonjourserviceresolver.h"


class BonjourClient : public QDialog
{
	Q_OBJECT

	public:
		BonjourClient(QWidget *parent = 0);

	private:
		QLabel *statusLabel;
		QPushButton *getInfoButton;
		QPushButton *quitButton;
		QDialogButtonBox *buttonBox;
		QTcpSocket *tcpSocket;
		BonjourServiceBrowser *bonjourBrowser;
		BonjourServiceResolver *bonjourResolver;

	private slots:
		void updateRecords(const QList<BonjourRecord> &list);
		void requestInfo();
		void readInfo();
		void displayError(QAbstractSocket::SocketError socketError);
		void enableGetInfoButton();
		void connectToServer(const QHostInfo &hostInfo, int);
};

#endif
